package cn.kgc.repository;

import cn.kgc.entity.CandFollowHrMo;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author YC
 */
@Repository
public interface CandFollowHrRepository extends MongoRepository<CandFollowHrMo, String> {

    /**
     * 根据求职者的id和hrId 查询记录数
     *
     * @param candUserId 求职者的id
     * @param hrId       HR的id
     * @return 记录数
     */
    int countByHrIdAndCandUserId(String hrId, String candUserId);

    /**
     * 根据hrId和求职者的Id删除数据
     */
    void deleteByHrIdAndCandUserId(String hrId, String candUserId);

    /**
     * 根据求职者的id查询关注HR记录数
     *
     * @param candUserId
     * @return
     */
    int countByCandUserId(String candUserId);

    /**
     * 分页查询求职者关注HR的信息
     * @param candUserId
     * @param pageable
     * @return
     */
    /**
     * 分页查询求着关注的HR的信息
     */
    List<CandFollowHrMo> findByCandUserIdOrderByCreataedDateDesc(String candUserId, Pageable pageable);

}
